package GUILayer;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TabFolder;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.TabItem;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;

public class GUIProduct {

	protected Shell shell;
	private Text text_SearchName;
	private Table table;
	private Text text_productId;
	private Text text_Name;
	private Text text_purchasePrice;
	private Text text_salePrice;
	private Text text_rentPrice;
	private Text text_countryOrigin;
	private Text text_minStock;

	/**
	 * Launch the application.
	 * @param args
	 */
	public static void main(String[] args) {
		try {
			GUICustomer window = new GUICustomer();
			window.open();
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	/**
	 * Open the window.
	 * @wbp.parser.entryPoint
	 */
	public void open() {
		Display display = Display.getDefault();
		createContents();
		shell.open();
		shell.layout();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

	/**
	 * Create contents of the window.
	 */
	protected void createContents() {
		shell = new Shell();
		shell.setSize(764, 468);
		shell.setText("SWT Application");
		
		Composite composite = new Composite(shell, SWT.NONE);
		composite.setBounds(0, 0, 748, 429);
		
		Composite composite_1 = new Composite(composite, SWT.NONE);
		composite_1.setBounds(0, 0, 748, 226);
		
		Composite composite_3 = new Composite(composite_1, SWT.NONE);
		composite_3.setBounds(86, 123, 558, 93);
		
		text_SearchName = new Text(composite_3, SWT.BORDER);
		text_SearchName.setBounds(86, 43, 273, 21);
		
		Button btnSearch = new Button(composite_3, SWT.NONE);
		btnSearch.setBounds(365, 43, 75, 25);
		btnSearch.setText("Search");
		
		Label lblSearchName = new Label(composite_3, SWT.NONE);
		lblSearchName.setBounds(25, 46, 55, 15);
		lblSearchName.setText("Name");
		
		ScrolledComposite scrolledComposite = new ScrolledComposite(composite_1, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
		scrolledComposite.setBounds(0, 0, 748, 120);
		scrolledComposite.setExpandHorizontal(true);
		scrolledComposite.setExpandVertical(true);
		
		table = new Table(scrolledComposite, SWT.BORDER | SWT.FULL_SELECTION);
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		
		TableColumn tblclmnID = new TableColumn(table, SWT.NONE);
		tblclmnID.setWidth(100);
		tblclmnID.setText("ID");
		
		TableColumn tblclmnName = new TableColumn(table, SWT.NONE);
		tblclmnName.setWidth(100);
		tblclmnName.setText("Name");
		scrolledComposite.setContent(table);
		scrolledComposite.setMinSize(table.computeSize(SWT.DEFAULT, SWT.DEFAULT));
		
		Composite composite_2 = new Composite(composite, SWT.NONE);
		composite_2.setBounds(0, 227, 748, 192);
		
		Composite composite_4 = new Composite(composite_2, SWT.NONE);
		composite_4.setBounds(0, 0, 748, 136);
		
		Label lblproductId = new Label(composite_4, SWT.NONE);
		lblproductId.setBounds(10, 1, 55, 15);
		lblproductId.setText("productId");
		
		Label lblName = new Label(composite_4, SWT.NONE);
		lblName.setBounds(10, 22, 55, 15);
		lblName.setText("Name");
		
		Label lblpurchasePrice = new Label(composite_4, SWT.NONE);
		lblpurchasePrice.setBounds(10, 43, 55, 15);
		lblpurchasePrice.setText("purchasePrice");
		
		Label lblrentPrice = new Label(composite_4, SWT.NONE);
		lblrentPrice.setBounds(10, 61, 55, 15);
		lblrentPrice.setText("rentPrice");
		
		Label lblcountryOrigin = new Label(composite_4, SWT.NONE);
		lblcountryOrigin.setBounds(0, 84, 82, 15);
		lblcountryOrigin.setText("countryOrigin");
		
		text_productId = new Text(composite_4, SWT.BORDER);
		text_productId.setBounds(88, 1, 299, 21);
		
		text_Name = new Text(composite_4, SWT.BORDER);
		text_Name.setBounds(88, 22, 299, 21);
		
		text_purchasePrice = new Text(composite_4, SWT.BORDER);
		text_purchasePrice.setBounds(88, 41, 299, 21);
		
		text_rentPrice = new Text(composite_4, SWT.BORDER);
		text_rentPrice.setBounds(88, 61, 299, 21);
		
		text_countryOrigin = new Text(composite_4, SWT.BORDER);
		text_countryOrigin.setBounds(88, 82, 299, 21);
		
		text_minStock = new Text(composite_4, SWT.BORDER);
		text_minStock.setBounds(88, 106, 299, 21);
		
		Label lblminStock = new Label(composite_4, SWT.NONE);
		lblminStock.setBounds(10, 112, 55, 15);
		lblminStock.setText("minStock");
		
		Composite composite_5 = new Composite(composite_2, SWT.NONE);
		composite_5.setBounds(0, 142, 748, 68);
		
		Button btnCreate = new Button(composite_5, SWT.NONE);
		btnCreate.setBounds(185, 10, 75, 41);
		btnCreate.setText("Create");
		
		Button btnSave = new Button(composite_5, SWT.NONE);
		btnSave.setBounds(266, 10, 75, 41);
		btnSave.setText("Save");
		
		Button btnEdit = new Button(composite_5, SWT.NONE);
		btnEdit.setBounds(347, 10, 75, 41);
		btnEdit.setText("Edit");
		
		Button btnDelete = new Button(composite_5, SWT.NONE);
		btnDelete.setBounds(428, 10, 75, 41);
		btnDelete.setText("Delete");

	}
}
